<template>
  <div class="topic">
    <div class="topic_list" v-for="item in topicList" :key="item.id">
      <img :src="item.scene_pic_url" alt="" />
      <h2>{{ item.title }}</h2>
      <h2>{{ item.subtitle }}</h2>
      <span style="color: darkred">
        <!-- 价格过滤器main.js -->
        {{ item.price_info | RMBFormat }}元起
      </span>
    </div>
  </div>
</template>

<script>
import { GetTopicList } from "../request/api.js";
export default {
  data() {
    return {
      topicList: [],
    };
  },
  created() {
    GetTopicList().then((res) => {
      // let {banner,channel,topicList} = res.data
      // this.banner = banner;
      // this.channelArr = channel;
      this.topicList = res.data.data;
      console.log(res.data.data);
    });
  },
};
</script>

<style lang = "less" scoped>
.topic {
  width: 100%;
  padding-bottom: 0.5rem;
  .topic_list {
    width: 100%;
    background-color: #fff;
    text-align: center;
    padding-bottom: 0.2rem;
    h2 {
      line-height: 40px;
      font-size: 0.18rem;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
      padding: 0 0.1rem;
    }
    span {
      display: block;
      line-height: 0.4rem;
    }
    img {
      width: 100%;
      height: 200px;
    }
  }
}
</style>
